<template>
  <div
    class="tankuang"
    v-if="isShow"
  >
    <div class="tankuang-main">
      <div class="title">{{ title }}</div>
      <div class="content"><img
          :src="src"
          v-if="src"
        /><span>{{ content }}</span></div>
      <div class="tankuang-caozuo">
        <a
          style="color: #373E4F;float: left;border-right: 0.5px solid #E8EAF0"
          @click="doCancle"
        >取消</a>
        <a
          style="color: #0077FF;float: right"
          @click="doConfirm"
        >确定</a>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["title", "content", "src"],
  data() {
    return {
      isShow: false
    };
  },

  methods: {
    show() {
      this.isShow = true;
    },
    hidden() {
      this.isShow = false;
    },
    doCancle() {
      this.$emit("doCancle");
    },
    doConfirm() {
      this.$emit("doConfirm");
    }
  }
};
</script>

<style scoped>
.tankuang-main {
  width: 80%;
  height: 120px;
  position: absolute;
  top: 40%;
  left: 10%;
  background-color: rgba(255, 255, 255, 1);
  border-radius: 25px;
  z-index: 100;
  text-align: center;
}

.title {
  height: 40px;
  font-size: 18px;
  font-family: PingFang-SC-Bold;
  font-weight: bold;
  color: #373e4f;
  line-height: 40px;
}

.content {
  vertical-align: top;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content span {
  font-size: 12px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #373e4f;
  line-height: 40px;
}

.content img {
  height: 25px;
  width: 25px;
  margin-right: 5px;
}

.tankuang-caozuo {
  height: 40px;
  line-height: 40px;
  display: flex;
}

.tankuang-caozuo a {
  display: inline-block;
  width: 50%;
  font-size: 18px;
  font-family: PingFang SC;
  font-weight: 500;
  line-height: 50px;
  height: 40px;
  line-height: 40px;
  border-top: 0.5px solid #e8eaf0;
}

.tankuang {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 23, 50, 0.5);
  /* opacity: 0.5; */
  z-index: 99;
}
</style>
